﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleServiceBus.Bus.Subscriptions
{
    public interface ISubscriptionRepository
    {
        IList<StoredSubscription> GetAllSubscriptions();

        void AddSubscription(Type messageType, string subscriber);
        void RemoveSubscription(Type messageType, string subscriber);

        void RemoveAllSubscriptionsForSubscriber(string subscriber);
    }

    [Serializable]
    public class StoredSubscription
    {
        public Type MessageType;
        public string Subscriber;

        public override string ToString()
        {
            return MessageType.Name + "::" + Subscriber;
        }
    }
}
